package com.cloud.sample.core.exception;

import com.cloud.sample.core.constant.BaseErrorCode;
import com.cloud.sample.core.constant.CoreErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author gjy
 * @since 2021/8/27
 */
@Data
public class BusinessException extends BaseException {

    private static final long serialVersionUID = -3058303468596987142L;


    public BusinessException() {
        this(CoreErrorCode.SERVER_ERROR);
    }

    public BusinessException(Integer errCode, String message) {
        super(errCode, message);
    }

    public BusinessException(BaseErrorCode errorCode) {
        super(errorCode);
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(BusinessException e) {
        this(e.getErrCode(), e.getMessage());
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return super.fillInStackTrace();
    }
}
